<template>
  <div class="post-pone-req-div">
          <el-table
          :data="postPoneInfo"
          style="width: 100%">
          <el-table-column
            prop="courseName"
            label="课程名"
            width="180">
          </el-table-column>
          <el-table-column
            prop="workName"
            label="作业名"
            width="180">
          </el-table-column>
          <el-table-column
            label="是否审批">
            <template slot-scope="scope">
              <el-tag v-if="scope.row.isReply == 0" type="danger">未审批</el-tag>
              <el-tag v-else type="success">已审批</el-tag>
            </template>
          </el-table-column>
          <!-- <el-table-column
            label="决定推迟时间">
            <template slot-scope="scope">
              <el-tag v-if="scope.row.isReply == 0" type="danger">未审批</el-tag>
              <el-tag v-else type="success">{{scope.row.postponeTime}}</el-tag>
            </template>
          </el-table-column> -->
          <el-table-column
          label="操作">
            <template slot-scope="scope">
              <el-button icon="el-icon-search" size="small" round @click="toWorkInfo(scope.row.wpId)">查看详情</el-button>
            </template>
          </el-table-column>
        </el-table>
  </div>
</template>

<script>
import { getWorkPospone } from '../../api/work'
export default {
  data() {
    return {
      postPoneInfo: []
    }
  },
  methods: {
    getPostpones() {
      getWorkPospone().then(res => {
        if (res.code == 200) {
          if (res.data.postpones != null) {
            this.postPoneInfo = res.data.postpones
          }
        }
      })
    },
    toWorkInfo(wpId) {
      this.$router.push({
        name:"postponeWorkInfo",
        params:{
          wpId: wpId
        }
      })
    }
  },
  mounted() {
    this.getPostpones()
  }
}
</script>

<style>
.post-pone-req-div {
  width: 96%;
  margin: 2%;
}

</style>